package com.supor.md_video.api;

import com.android.baseconfig.base.BaseApiResult;
import com.supor.aiot.common.app.Constants;
import com.supor.md_video.entity.VideoCommListBean;
import com.supor.md_video.entity.VideoCommListResultBean;
import com.supor.md_video.entity.VideoCommThumbsBean;
import com.supor.md_video.entity.VideoFavoritBean;
import com.supor.md_video.entity.VideoListBean;

import java.util.Map;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface VideoApiService {

    @GET(Constants.OSS_API + "foodTRecipe/pageList")
    Observable<BaseApiResult<VideoListBean>> getVideoList(@Query("recipeStatus") String recipeStatus,
                                                          @Query("recipeType") String recipeType,
                                                          @Query("providerId") String providerId,
                                                          @Query("limit") int limit,
                                                          @Query("page") int page
    );

    @GET(Constants.OSS_API + "bossTPublicReply/pageList")
    Observable<BaseApiResult<VideoCommListResultBean>> getVideoCommList(
            @Query("addrId") String addrId,
            @Query("limit") int limit,
            @Query("page") int page,
            @Query("replyAddr") String replyAddr
    );

    @GET(Constants.OSS_API + "bossTPublicReply/replyFilter")
    Observable<BaseApiResult<String>> commFilter(
            @Query("text") String text
    );

    @POST(Constants.OSS_API + "bossTPublicReply")
    Observable<BaseApiResult<VideoCommListBean>> addComm(
            @Body RequestBody requestBody
    );

    @POST(Constants.OSS_API + "bossTPublicFavorite")
    Observable<BaseApiResult<VideoFavoritBean>> subRecipe(
            @Body RequestBody requestBody
    );

    @GET(Constants.OSS_API + "bossTPublicFavorite/del/{id}")
    Observable<BaseApiResult<VideoFavoritBean>> subRecipeDel(
            @Path("id") String id

    );

    @POST(Constants.OSS_API + "bossTPublicLike")
    Observable<BaseApiResult<VideoCommThumbsBean>> commThumbs(
            @Body RequestBody requestBody
    );

    @POST(Constants.OSS_API + "bossTPublicLike/del/{id}")
    Observable<BaseApiResult<String>> commThumbsDel(@Path("id") String id);

    /**
     * 分享统计
     *
     * @param id 食谱id
     * @return
     */
    @POST(Constants.OSS_API + "foodTRecipe/update/{recipeId}")
    Observable<BaseApiResult<String>> shareUpdate(@Path("recipeId") String id, @Body Map<String, String> map);

}
